﻿using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using Barotrauma;
using HarmonyLib;
using Microsoft.Xna.Framework;

#if CLIENT
[assembly: IgnoresAccessChecksTo("Barotrauma")]
#endif
#if SERVER
[assembly: IgnoresAccessChecksTo("DedicatedServer")]
#endif
[assembly: IgnoresAccessChecksTo("BarotraumaCore")]

namespace DSSI
{
    public partial class Plugin : IAssemblyPlugin
    {
        private Harmony harmony;

        public void Initialize()
        {
            harmony = new Harmony("dssi");
            LuaCsLogger.LogMessage($"Patching {harmony}...");
            harmony.PatchAll();
        }

        public void OnLoadCompleted()
        {

        }

        public void PreInitPatching()
        {

        }

        public void Dispose()
        {
            harmony?.UnpatchSelf();
            harmony = null;
        }
    }
}
